package com.kstudio.videocapture;

import android.app.Application;
import android.content.SharedPreferences;
import android.os.Environment;
import android.util.Log;

public class KVideoCapture extends Application {

    private String mCurrentPath;
    private String mStoragePath;
    private int mBaseIconWidth;
    private int mBaseIconHeight;

    @Override
    public void onCreate() {
        super.onCreate();

        SharedPreferences prefs = getSharedPreferences("KVideoCapture", MODE_PRIVATE);
        mCurrentPath = prefs.getString("CurrentPath", Environment.getExternalStorageDirectory().getAbsolutePath());
        mStoragePath = prefs.getString("RepositoryPath", Environment.getExternalStorageDirectory().getAbsolutePath()+"/KVideoCapture/");
        Log.e("KKH","mCurrentPath = "+mCurrentPath);
        Log.e("KKH","mCurrentPath = "+Environment.getExternalStorageDirectory().getAbsolutePath());
    }

    public String getCurrentPath() {
        return mCurrentPath;
    }

    public String getStoragePath() {
        return mStoragePath;
    }

    public int getBaseIconWidth()  {
        return mBaseIconWidth;
    }

    public int getBaseIconHeight() {
        return mBaseIconHeight;
    }

    public void setCurrentPath(String path) {
        SharedPreferences prefs = getSharedPreferences("KVideoCapture", MODE_PRIVATE);
        SharedPreferences.Editor editor = prefs.edit();
        editor.putString("CurrentPath", path);
        editor.commit();

        mCurrentPath = path;
    }

    public void setStoragePath(String path) {
        SharedPreferences prefs = getSharedPreferences("KVideoCapture", MODE_PRIVATE);
        SharedPreferences.Editor editor = prefs.edit();
        editor.putString("RepositoryPath", path);
        editor.commit();

        mStoragePath = path;
    }
}
